var Dog = require("./dog.js"); //相当于import
var dog = new Dog("taidy");
//dog对象具备EventEmitter的属性方法
dog.on("bark",() => {
    console.log(this);
    dog.bark();
})

setTimeout(() => {
    dog.emit("bark");
},3000)